/*
 * @Author: xiaosihan 
 * @Date: 2023-12-24 07:23:11 
 * @Last Modified by: xiaosihan
 * @Last Modified time: 2024-12-01 03:53:22
 */


import { autorun } from "mobx";
import { ReactNode, useEffect, useRef, useState } from "react";
import styles from "./loadding.module.less";
import editorStore from "@/editorComponent/editorStore";
import { Spin } from "antd";

interface Iprops {
  children?: ReactNode
}

//  加载动画
export default function Loadding(props: Iprops) {

  const dom = useRef<HTMLDivElement | null>(null);
  const [data, setData] = useState({});

  const [loadding, setLoadding] = useState(editorStore.loadding);

  useEffect(() => autorun(() => {
    setLoadding(editorStore.loadding);
  }), []);

  useEffect(() => {

  }, []);

  useEffect(() => autorun(() => {

  }), []);

  return (
    <Spin
      className={styles.loadding}
      spinning={loadding}
    />
  );

}